import {API_CONFIG} from './abi.js'
import { localStorage } from "@/utils/local-storage";


let USDT_CONTRACT_ADDRESS = '0x55d398326f99059fF775485246999027B3197955'
let NODE_RECEIVER_ADDRESS = '0x1E380394d0E68bB0838FCfa647b75a3B759469ab'
 

let NETWORK = {
    "binance":{
    chainId: '0x38', //56
    rpcUrls: ['https://rpc.ankr.com/bsc'],
    chainName: 'Binance Smart Chain Mainnet',
    blockExplorerUrls: ['https://bscscan.com'],
    nativeCurrency: {
        name: 'BNB',
        symbol: 'BNB',
        decimals: 18
    },
    nftAddress:'0xa88DCbe64df4CD6B0FB1Fed46eF564a4F3382BD5',
    pizzaAddress:'0x467B440415F6ae415093B02f0cF93520387eE91c'
},
"polygon":{
    chainId: '0x89', //137
    rpcUrls: ['https://polygon.meowrpc.com'],
    chainName: 'Polygon Mainnet',
    blockExplorerUrls: ['https://polygonscan.com/'],
    nativeCurrency: {
        name: 'MATIC',
        symbol: 'MATIC',
        decimals: 18
    },
    nftAddress:'0xC8203A1A9f624617E09102db951e37E65887Ad8B',
    pizzaAddress:'0xa8b6aEB2269829e0da9504251822F3C425359fF9'
}
}
function getNetwork(){
    return NETWORK[localStorage.get("network")||"binance"]
}

export {
    USDT_CONTRACT_ADDRESS,
    NODE_RECEIVER_ADDRESS,
    getNetwork,
    API_CONFIG
}

export const ERROR_INFO = {
    '4001': '用戶拒絕鏈接',
    '-32602': '參數錯誤',
    '-32603': '系統錯誤',
    '-32002': '請打開錢包',
    ACCOUNT_DIS: '賬戶已斷開',
    SYSTEM_ERROR: '系統錯誤'
}
